﻿<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh-CN">
<head>
<%@ include file="/include/include.jsp" %>
<script>
 function deleteUser(id){
	if(confirm("您确定删除该用户吗？")){
		$('form').action='${ctx}/user/usermanager/'+id+'/delete';
		$('form').submit();
	}
}

</script>
			
</head>

<body>
	
	<%@ include file="/include/header.jsp" %>

	<%@ include file="/include/menu.jsp" %>
	<form id='form' action="" method="post"></form>
	
	<div id="mainContent">
		<h2><a href="${ctx}/${menu.url}">${menu.description}</a>&nbsp;-&nbsp;<a href="${ctx}/${empty currViewBarSubMenu_ ? submenu.url : currViewBarSubMenu_.url}">${empty currViewBarSubMenu_ ? submenu.description : currViewBarSubMenu_.description}</a></h2>
		
		<div class="tool-bar">
			<div title="${menu.description} - ${empty currViewBarSubMenu_ ? submenu.description : currViewBarSubMenu_.description} - 查询${empty currViewBarSubMenu_ ? submenu.description : currViewBarSubMenu_.description}"  href="${ctx}/user/usermanager/search" class="modal-window modal-link">过滤查询</div>
			<div title="${menu.description} - ${empty currViewBarSubMenu_ ? submenu.description : currViewBarSubMenu_.description} - 添加${empty currViewBarSubMenu_ ? submenu.description : currViewBarSubMenu_.description}"  href="${ctx}/user/usermanager/add" class="modal-window modal-link">添加用户</div>
		</div>
		
		<div class="grid-list">
			<table class="grid" cellspacing="0">
				<thead>
					<tr>
						<td>用户名</td>
						<td>用户职位</td>
						<td>email</td>
						<td>联系电话</td>
						<td>状态</td>
						<td>描述</td>
						<td>操作</td>
					</tr>
				</thead>
				<tbody>
					<c:forEach var="user" items="${users}">
						<tr onmouseover="this.style.backgroundColor= '#A0CFEC'" onmouseout="this.style.backgroundColor= '#ffffff'">
							<td>${user.name}</td>
							<td>${user.position}</td>
							<td>${user.email}</td>
							<td>${user.telephone}</td>
							<td>${empty user.disabled || user.disabled ? '禁用' : '启用'}</td>
							<td>${user.description}</td>
							<td class="tool-bar-tr">
								<div title="${menu.description} - ${empty currViewBarSubMenu_ ? submenu.description : currViewBarSubMenu_.description} - 修改${empty currViewBarSubMenu_ ? submenu.description : currViewBarSubMenu_.description}"  href="${ctx}/user/usermanager/${user.id}/modifyrole" class="modal-window modal-link">分配角色</div>
								<a href="javascript:deleteUser(${user.id});" > 删除用户</a>
								<div title="${menu.description} - ${empty currViewBarSubMenu_ ? submenu.description : currViewBarSubMenu_.description} - 修改${empty currViewBarSubMenu_ ? submenu.description : currViewBarSubMenu_.description}"  href="${ctx}/user/usermanager/${user.id}/edit" class="modal-window modal-link">修改用户</div>
							</td>
						</tr>
					</c:forEach>
				</tbody>
			</table>
				
			<t:page action="${ctx}/user/usermanager/list" />
			
		</div>
	</div>
	
	<%@ include file="/include/script.jsp" %>
	
</body>

</html> 